package com.edu.whty.service;

import com.alibaba.fastjson.JSONObject;
import com.edu.whty.entity.base.BaseRequest;
import com.edu.whty.entity.base.CloudPage;
import com.edu.whty.entity.base.PageList;
import com.edu.whty.entity.cloud.*;

import java.util.List;
import java.util.Map;

public interface CourseService {

      /**
       * 删除资源
       * @param deleteCloudReq
       */
      public void deleteCloud(DeleteCloudReq deleteCloudReq, String netIp);


      /**
       * 移动资源
       * @param MoveCloudReq
       */
      public void  moveCloud(MoveCloudReq moveCloud);

      //资源上传后保存相关资源信息
      public Map<String,Object> saveCloudRes(List<UserResRequest2> userReslist,String isPackage,String flag) throws Exception;

      public void updateResourceInfo(UpdateResourceInfo baseRequest);

      /**
	 * 根据courseId查询
	 * @param resourceId
	 * @return
	 * @throws Exception
	 */
	  public TbCourseRes getResByResId(String resourceId)throws Exception;

	  /**
	 * 根据packageId查询资源包下的资源列表
	 * @param packageId
	 * @return
	 * @throws Exception
	 */
	  public List<TbCourseRes> getResByPackageId(String packageId)throws Exception;

    public CloudPage<TbCourseRes> cloudList(CloudPageReq cloudPage);

    List<TbCourseRes> initCourseResList(CloudPageReq cloudPage);

    List<TbCourseUser> initCourseUserList(CloudPageReq cloudPage);

    void saveCourseResBatch(List<TbCourseRes> list);

    void saveCourseUserBatch(List<TbCourseUser> list);

    /**
	 * 批量同步课程资源
	 * @param List
	 * @throws Exception
	 */
    void syncCourseResBatch(List<Map<String, Object>> list, String type);

    /**
	 * 批量同步用户课程
	 * @param List
	 * @throws Exception
	 */
    void syncCourseUserBatch(List<Map<String, Object>> list, String type);

    /**
	 * 批量同步课程资源
	 * @param List
	 * @throws Exception
	 */
	void syncSaveOrUpdateCourseResBatch(List<Map<String, Object>> list);

	/**
	 * 批量同步用户课程
	 * @param List
	 * @throws Exception
	 */
	void syncSaveOrUpdateCourseUserBatch(List<Map<String, Object>> list);

    /**
	 * 获取待上行同步的课程资源
	 * @throws Exception
	 */
    List<Map<String, Object>> getUpSyncCourseRes() throws Exception;

    /**
	 * 获取待上行同步的用户课程
	 * @throws Exception
	 */
    List<Map<String, Object>> getUpSyncCourseUser() throws Exception;

    /**
	 * 更新待同步课程资源为已同步
	 * @throws Exception
	 */
    void finishUpSyncCourseRes() throws Exception;

    /**
	 * 更新待同步用户课程为已同步
	 * @throws Exception
	 */
    void finishUpSyncCourseUser() throws Exception;

    int statCloud(TbCourseRes tbCourseRes)throws Exception;

    /**
	 * 比对同步用户课程
	 * @throws Exception
	 */
	void compareSyncCourseRes(List<TbCourseUser> courseUserList, List<TbCourseRes> courseResList) throws Exception;

	void addDownCount(String resId);

	void updateCloud(TbCourseRes tbCourseRes);

	void finishUpSyncCourseUserByOrgId(String resId)throws Exception;

	void finishUpSyncCourseResByOrgId(String resId)throws Exception;

    void saveUserRes(com.alibaba.fastjson.JSONObject json)throws Exception;

	void delUserRes(com.alibaba.fastjson.JSONObject json)throws Exception;

    void updateStatus(com.alibaba.fastjson.JSONObject json)throws Exception;

	TbCourseUser getUserByCourseId(String courseId);

    Map<String,Object> saveXitiCloudRes(List<UserResRequest2> userResList, String isPackage)throws Exception;

	void updateUserRes(JSONObject json) throws Exception;

	void moveUserRes(JSONObject json)throws Exception;

	TbCourseUser getUserByResId(String resId);

	void updateBycourseResId(TbCourseUser tbCourseUser);

    List<TbCourseRes> queryLyData(Map map);

	Map<String, Object> saveShangHaiCloudRes(List<UserResRequest2> userResList) throws Exception;

	void deleteShangHaiCloud(List<String> resIdList);
}
